<template>
  <div class="main-footer fn-textcenter">
        <div>欢迎您！您已在这里逗留了{{d}}秒</div> 
  </div>
</template>


<script>
export default {
  data(){
    return {
      d:0,
      timer:null,
    }
  },
  methods:{
    getDate(){
      this.timer = setInterval(this.autoPlay,1000)
    },
    autoPlay(){
      this.d++;
    }
  },
  mounted(){
    this.getDate()
  },
  destroyed(){
    clearInterval(this.timer);
  }
}
</script>